{extend name='public/base' /}


{block name="content"}
<style type="text/css">
    .tittle {
        text-align: center;
        margin: 20px 0;
        font-size: 24px;
    }

    .box {
        width: 130px !important;
    }

    .auto {
        margin-left: 160px !important;
    }
</style>
<div class="layui-col-md12">

    <div class="layui-card">

        <div class="layui-card-body">

            <div class="layui-card-header">销售配置</div>
            <div class="layui-card-body">

                <div class="layui-form" lay-filter="">


                    <div class="layui-form-item">
                        <label class="layui-form-label box">是否自动审核</label>
                        <div class="layui-input-inline" style="width: 190px;">
                            <select lay-verify="required" name="is_apply" id="is_apply">
                                <option value=""></option>
                                <option value="0">否</option>
                                <option value="1">是</option>
                            </select>
                        </div>
                    </div>

                    <hr>

                    <div class="layui-form-item" style="visibility: hidden;">
                        <label class="layui-form-label">id</label>
                        <div class="layui-input-inline">
                            <input type="text" name="id" value="" id="id" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <button class="layui-btn" lay-submit="" lay-filter="setmypass">确认修改</button>
                        </div>
                    </div>


                </div>

            </div>


        </div>
    </div>

</div>


{/block}

{block name="js"}
<!--js处理区-->

<script>

    layui.use(['element', 'form', 'jquery', 'lucky'], function () {
        var element = layui.element;
        var form = layui.form;
        var $ = layui.jquery;
        var lucky = layui.lucky;

        form.render();

        /**
         * 表格{:__('Submit')}
         */
        form.on('submit(setmypass)', function (data) {
            lucky.FormSubmit("{:url('saveconfig')}", data.field);
            return false;
        });

        TableHeaders({});
        function TableHeaders(datas) {
            $.ajax({
                url: "{:url('index')}",
                type: "get",
                data: datas,
                dataType: "json",
                success: function (data) {
      
                    $("#id").val(data.data.id)
                    $("#is_apply").val(data.data.is_apply);
                    layui.form.render('select');
                    console.log(data)
                }
            });
        }
    });

    layui.use('laydate', function () {
        var laydate = layui.laydate;

        //执行一个laydate实例
        laydate.render({
            elem: '#send_time', //指定元素
            format: 'yyyy-MM-dd HH:mm:ss',
            type: 'datetime'
        });
    });

</script>


{/block}